Clipping is a type of distortion that occurs when a signal exceeds an amplitude threshold. An amplitude threshold may be a limit of the dynamic range of a system. Upper and lower amplitude thresholds may define the bounds of the dynamic range.
A system “clips” a signal by reducing all values that exceed the upper or lower amplitude thresholds. Clipping introduces high frequency harmonics to the signal's frequency spectrum.
The dynamic range is a characteristic of a system to which the signal is being input. For example, an analog signal may be limited to a voltage range provided by a positive voltage source and negative voltage source for a system. As another example, a sample for a digital signal may be limited to a predetermined number of levels, such as when signal samples are quantized to 8 bits.
In the context of an audio signal, pulse code modulation (PCM) clipping occurs when high precision digital samples are being converted to lower precision PCM samples. For example, PCM clipping may occur when a 32-bit sample output from an audio decoder is converted to a 1.6-bit sample. As another example, PCM clipping may occur when 24-bit samples are provided to a 16-bit input of an encoder. Other audio processes like graphic equalization and mixing may lead to PCM clipping.
Practical systems, such as audio encoders/decoders and amplifiers, are limited in dynamic range. A system designer should consider design tradeoffs, such as between memory or voltage source requirements and cost, when selecting a dynamic range for a system. The system designer should contemplate how the system will respond to an input signal that exceeds the dynamic range of the system. Specifically, the system designer should determine how an input signal will be represented inside the system when it exceeds the system's dynamic range.
One solution for dealing with input signals that exceed the dynamic range is to effectively prevent the signal from being input to the system if it exceeds the dynamic range. The system may be protected using a fuse or similar device which disables the system when the dynamic range is exceeded.
Another solution for dealing with signals that exceed the dynamic range of the system is to simply represent portions of the input signal exceeding the dynamic range by the amplitude threshold. This solution produces a “clipped” signal, where the portions of the signal exceeding the upper and lower amplitude thresholds appear cut off. This type of system is said to hard clip the signal.
To avoid clipping, the gain of the input signal may be reduced. For example, if the signal is known, the gain may be set such that the peak value of the signal is made equal to the amplitude threshold. This technique may be used, for example, when preparing an audio track to be written to a compact disc (CD). Because the gain is reduced for the entire signal, no distortion is introduced to the signal.
In many circumstances, the input signal is not fully known before the system begins processing the signal. Because the range of the signal is not known, a fixed gain, other than zero, cannot be chosen to ensure that clipping is prevented. Dynamic range compression (DRC) may be used to dynamically adjust the gain of a signal. Clipping may be viewed as a form of dynamic range compression. Though, the amount of distortion introduced, by clipping is generally undesirable.
In the context of an audio signal, clipping produces “popping” and “distortion” when played back to a listener. When the audio signal is musical, clipping may prevent a note from decaying in a normal amount of time, resulting in notes played in close succession to blend together. Also, all the clipped portions of the music will sound equally loud since they are all being played at the limit of the dynamic range.